#ifndef PTABLEWIDGET_H
#define PTABLEWIDGET_H

#include <QTableWidget>
#include <QDataStream>
#include <QFile>

#include "taskType.h"

class PTableWidget : public QTableWidget
{
    Q_OBJECT
private:
    QMap<QString, bool> itemNames;
    QVector<itemType> items;

    int LoadDataFromFile( const QString& fileName );
    int SaveDataToFile( const QString& fileName );

public:
    PTableWidget(QWidget *parent);

    int loadData();
    int saveData();
    void updateTable();

    int insertItem( itemType& item );
    int editItem( int row, itemType& item );
    int deleteItem( int row );

    void getItems( QVector<itemType>& items );

};

#endif // PTABLEWIDGET_H
